﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Sagacity.NC.Web.FormForm;
using Coolite.Ext.Web;

namespace Sagacity.NC.Web.BaokaoManager.HighSchool
{
    public partial class BatchDetail : PageBase
    {
     public   int resourceId = 0;
       public int batchId = 0;
       public int showStyle = 0;

        protected void Page_Load(object sender, EventArgs e)
        {
            resourceId = Request.QueryString["ResourceId"] == null ? 0 : int.Parse(Request.QueryString["ResourceId"]);
            batchId = Request.QueryString["batchId"] == null ? 0 : int.Parse(Request.QueryString["batchId"]);
         
             showStyle = Request.QueryString["showStyle"] == null ? 2 : int.Parse(Request.QueryString["showStyle"]);
           //  HostFormCommon1.AddFields.Add(hidParenId.Value, hidParenIdValue.Value);
             hidParenIdValue.Value = batchId.ToString();
            Sagacity.Entity.Query.FilterInfo filter = new Sagacity.Entity.Query.FilterInfo("Batch_Id", "=", batchId);
             this.HostFormCommon1.Filters.Add(filter);
            this.HostFormCommon1.CurrentUser = CurrentUser;
            this.HostFormCommon1.ShowPlan = (ShowPlan)showStyle;
            this.HostFormCommon1.ResourceId = resourceId;
         
                AddButton();
        }


        public void AddButton()
        {
            //增加按钮
            Coolite.Ext.Web.ToolbarButton btnAdd = new Coolite.Ext.Web.ToolbarButton();
            btnAdd.ID = "btnAdd";
            btnAdd.Visible = true;
            btnAdd.Enabled = true;
            btnAdd.Text = "新增";
            btnAdd.Icon = Icon.Add;
            btnAdd.Listeners.Click.Handler = "javascript:NewFunction()";
            HostFormCommon1.BtnControls.Add(btnAdd);

            //删除按钮
            Coolite.Ext.Web.ToolbarButton btnDelete = new Coolite.Ext.Web.ToolbarButton();
            btnDelete.ID = "btnDel";
            btnDelete.Visible = true;
            btnDelete.Enabled = true;
            btnDelete.Text = "删除";
            btnDelete.Icon = Icon.Delete;
            btnDelete.Listeners.Click.Handler = "javascript:DelFunction()";
            HostFormCommon1.BtnControls.Add(btnDelete);


        }

    }
}
